home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4861 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  4.4 KB

  1. Path: labhp33.cs.utah.edu!stack
  2. From: stack@labhp33.cs.utah.edu (Timothy Stack)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Boopsi
  5. Date: 5 Mar 1996 15:54:36 GMT
  6. Organization: University of Utah Computer Center
  7. Message-ID: <4hho3s$snt@news.cc.utah.edu>
  8. References: <3425.6632T1029T1644@cycor.ca>
  9. NNTP-Posting-Host: labhp33.cs.utah.edu
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. gcaine (gcaine@cycor.ca) wrote:
  13. : What's the trick to getting a frame around boopsi gadgets?
  14.  
  15. : I tried the example in the RKM libraries book, and the string gadget
  16. : has no border. I then tried a frbuttonclass gadget, with text. I passed
  17. : it the DrawInfo with the GA_DrawInfo tag, and I get the text, but that's
  18. : all.
  19.  
  20. : Here's a test program to show what I mean.
  21.  
  22. : ----------------------------------Cut---------------------------------
  23.  
  24. : #include <exec/types.h>
  25. : #include <utility/tagitem.h>
  26. : #include <intuition/intuition.h>
  27. : #include <intuition/gadgetclass.h>
  28.  
  29. : #include <proto/exec.h>
  30. : #include <proto/intuition.h>
  31.  
  32. : struct Window *w;
  33. : struct IntuiMessage *msg;
  34. : struct Gadget *testGad;
  35.  
  36.  
  37.  
  38. : #define TESTGAD_ID       1L
  39. : #define MINWINDOWWIDTH      80
  40. : #define MINWINDOWHEIGHT     70
  41.  
  42. : void main(void)
  43. : {
  44. :     BOOL done = FALSE;
  45. :     struct DrawInfo *drawInfo = NULL;
  46. :     struct Screen *pubScn = NULL;
  47.  
  48. :     
  49. :     if (IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", 37L))
  50. :     {
  51. :         if (pubScn = LockPubScreen(NULL))
  52. :         {
  53. :             if (drawInfo = GetScreenDrawInfo(pubScn))
  54. :             {
  55.  
  56. :                 if (w = OpenWindowTags(NULL,
  57. :                     WA_Flags,       WFLG_DEPTHGADGET | WFLG_DRAGBAR |
  58. :                             WFLG_CLOSEGADGET | WFLG_SIZEGADGET,
  59. :                     WA_IDCMP,       IDCMP_CLOSEWINDOW | IDCMP_GADGETUP,
  60. :                     WA_MinWidth,    MINWINDOWWIDTH,
  61. :                     WA_MinHeight,   MINWINDOWHEIGHT,
  62. :                     TAG_END))
  63. :                 {
  64. :                     if (testGad = (struct Gadget *)NewObject(NULL, 
  65. :                         "frbuttonclass",
  66. :                         GA_ID,          TESTGAD_ID,
  67. :                         GA_Top,         (w->BorderTop) + 10L,
  68. :                         GA_Left,        (w->BorderLeft) + 5L,
  69. :                         GA_Width,       25,
  70. :                         GA_Height,      12,
  71. :                         GA_DrawInfo,    drawInfo,
  72. :                         GA_Text,        (ULONG)"Test",
  73. :                         TAG_END))
  74.  
  75. :                     {
  76. :                                                         
  77. :                         AddGList(w, testGad, -1, -1, NULL);
  78. :                         RefreshGList(testGad, w, NULL, -1);
  79. :                     
  80. :                         while (done == FALSE)
  81. :                         {
  82. :                             WaitPort((struct MsgPort *)w->UserPort);
  83. :                             while (msg = (struct IntuiMessage *)
  84. :                             GetMsg((struct MsgPort *)w->UserPort))
  85. :                             {
  86. :                                 if (msg->Class == IDCMP_CLOSEWINDOW)
  87. :                                 done = TRUE;
  88. :                                 ReplyMsg((struct Message *)msg);
  89. :                             }
  90. :                         }
  91. :                         RemoveGList(w, testGad, -1);
  92. :                         DisposeObject(testGad);
  93. :                     }
  94. :                     CloseWindow(w);
  95. :                 }
  96. :                 FreeScreenDrawInfo(pubScn, drawInfo);
  97. :                 drawInfo = NULL;
  98. :             }
  99. :             
  100. :             UnlockPubScreen(NULL, pubScn);
  101. :             pubScn = NULL;
  102. :         }
  103. :         CloseLibrary((struct Library *)IntuitionBase);
  104. :     }
  105. : }
  106. : --------------------------------End Cut-------------------------------
  107.  
  108. : I've just started playing with boopsi now, but I could use some help.
  109.  
  110. : Does anyone know where I can get some more documentation, or tutorials?
  111.  
  112. : Gary Caine    Member: Team AMIGA
  113.  
  114. First of all, RTFM.  You need to provide the frame for frbutton.  So
  115. create a frameiclass object and pass it to your frbutton through
  116. GA_Image or GA_LabelImage i cant remember.
  117.  
  118. So i think works like this...
  119.  
  120. myframe = NewObject( NULL, "frameiclass",
  121.             IA_Left, 0,
  122.             IA_Top, 0,
  123.             IA_Height, height,
  124.             IA_Width, width,
  125.             IA_EdgesOnly, TRUE,
  126.             TAG_DONE )
  127. button = NewObject( NULL, "frbuttonclass",
  128.             GA_Left, left,
  129.             GA_Top, top,
  130.             GA_Width, width,
  131.             GA_Height, height,
  132.             GA_Image, myframe,
  133.             GA_Text, "Text",
  134.             TAG_DONE )
  135.